overlay: Use actual size of the overlay when positioning
authorBenjamin Otte <otte@redhat.com>
Thu, 20 Aug 2015 22:44:17 +0000 (00:44 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 20 Aug 2015 22:47:30 +0000 (00:47 +0200)
Previously we were using the natural requested size which is unrelated.

gtk/gtkoverlay.c

index 48278e500453a9d53835a9c5ea2e7513c8d492b3..75253a5932a5fcf9049a9e7cae9da569cd20c021 100644 (file)
@@ -369,10 +369,10 @@ gtk_overlay_get_child_position (GtkOverlay    *overlay,
       alloc->width = MAX (alloc->width, main_alloc.width);
       break;
     case GTK_ALIGN_CENTER:
-      alloc->x += main_alloc.width / 2 - req.width / 2;
+      alloc->x += main_alloc.width / 2 - alloc->width / 2;
       break;
     case GTK_ALIGN_END:
-      alloc->x += main_alloc.width - req.width;
+      alloc->x += main_alloc.width - alloc->width;
       break;
     case GTK_ALIGN_BASELINE:
     default:
@@ -392,10 +392,10 @@ gtk_overlay_get_child_position (GtkOverlay    *overlay,
       alloc->height = MAX (alloc->height, main_alloc.height);
       break;
     case GTK_ALIGN_CENTER:
-      alloc->y += main_alloc.height / 2 - req.height / 2;
+      alloc->y += main_alloc.height / 2 - alloc->height / 2;
       break;
     case GTK_ALIGN_END:
-      alloc->y += main_alloc.height - req.height;
+      alloc->y += main_alloc.height - alloc->height;
       break;
     case GTK_ALIGN_BASELINE:
     default: